package com.winsdom.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

@Data
public class OrganizationMegVO {
    @ApiModelProperty(value = "主键id", example = "1")
    private Long id;

    @ApiModelProperty(value = "组织ID", example = "101")
    private Long categoryId;

    @ApiModelProperty(value = "组织名称(企业名称)", example = "XXX企业")
    private String organizationName;

    @ApiModelProperty(value = "上级组织名", example = "XX组织")
    private String SuperiorOrganizationName;

    @ApiModelProperty(value = "统一社会信用码", example = "91440101MA5X123456")
    private String societyCode;

    @ApiModelProperty(value = "开户行", example = "中国银行重庆渝北两江支行")
    private String openingBank;

    @ApiModelProperty(value = "银行账号", example = "87791409888124561")
    private String bankAccount;

    @ApiModelProperty(value = "注册区域，例如：[\"浙江省\", \"杭州市\", \"西湖区\"]", example = "[\"浙江省\", \"杭州市\", \"西湖区\"]")
    private String area;

    public List<String> getArea() {
        if (area == null || area.isEmpty()) {
            return Collections.emptyList();
        }
        return Arrays.asList(area.replaceAll("^\\[|\\]$", "").replaceAll("\"", "").split(",\\s*"));
    }

    @ApiModelProperty(value = "注册区域码，例如：[\"11\", \"1101\", \"110105\"]", example = "[\"11\", \"1101\", \"110105\"]")
    private String areaCode;

    public List<String> getAreaCode() {
        if (areaCode == null || areaCode.isEmpty()) {
            return Collections.emptyList();
        }
        return Arrays.asList(areaCode.replaceAll("^\\[|\\]$", "").replaceAll("\"", "").split(",\\s*"));
    }

    @ApiModelProperty(value = "详情地址", example = "example_address")
    private String address;

    @ApiModelProperty(value = "电话，例如：[\"12345678911\", \"12345678911\", \"12345678911\"]", example = "[\"12345678911\", \"12345678911\", \"12345678911\"]")
    private String phone;

    public List<String> getPhone() {
        if (phone == null || phone.isEmpty()) {
            return Collections.emptyList();
        }
        return Arrays.asList(phone.replaceAll("^\\[|\\]$", "").replaceAll("\"", "").split(",\\s*"));
    }

    @ApiModelProperty(value = "是否为开票组织（0=否，1=是）", example = "1")
    private Integer status;
}